import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询公寓收租计划列表
 * @param query
 * @returns {*}
 */

export const listFlatRentCollectionPlan = (query): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/apartmentRentCollectionPlan/list',
    method: 'get',
    params: query
  });
};

/**
 * 新增公寓收租计划
 * @param query
 * @returns {*}
 */

export const createFlatRentCollectionPlan = (data): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/apartmentRentCollectionPlan',
    method: 'post',
    data
  });
};

/**
 * 修改公寓收租计划
 * @param query
 * @returns {*}
 */

export const updateFlatRentCollectionPlan = (data): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/apartmentRentCollectionPlan',
    method: 'put',
    data
  });
};

/**
 * 删除公寓收租计划
 * @param query
 * @returns {*}
 */

export const deleteFlatRentCollectionPlan = (id): AxiosPromise<any> => {
  return request({
    url: '/zichanguanli/apartmentRentCollectionPlan/' + id,
    method: 'delete'
  });
};
